using System;
using System.Collections.Generic;
using BlueLotus7.Common;
using BlueLotus7.Eden.Service.Properties;


namespace BlueLotus7.Eden.Service
{
    public static class Global
    {
        private static Logger logger = new Logger("EdenService", Settings.Default.LogContainer, true, false, "EdenService");

        public static Dictionary<Guid, SettingSyncItem> StatusClientSyncList = new Dictionary<Guid, SettingSyncItem>();

        public static Dictionary<Guid, SettingSyncItem> ArticleClientSyncList = new Dictionary<Guid, SettingSyncItem>();

        public static void UpdateStatusStamp(Guid domainScopeKey)
        {
            foreach (Guid key in StatusClientSyncList.Keys)
            {
                SettingSyncItem item = StatusClientSyncList[key];
                if (item.DomainScopeKey == domainScopeKey)
                {
                    item.LastUpdateStamp = DateTime.Now;
                }
            }
        }

        public static void UpdateTaskStamp(Guid clientKey)
        {
            if (ArticleClientSyncList.ContainsKey(clientKey))
            {
                ArticleClientSyncList[clientKey].LastUpdateStamp = DateTime.Now;
            }
        }

        public static Logger Logger
        {
            get
            {
                return logger;
            }
        }
    }
}

